Skip to content

Fix liboat_hook.so inaccessible in some device#190

Merged
JingMatrix merged 3 commits intomasterfrom
dex2oat
Feb 17, 2025
Merged

Fix liboat_hook.so inaccessible in some device#190
JingMatrix merged 3 commits intomasterfrom
dex2oat

Conversation

@JingMatrix
Copy link
Copy Markdown
Owner

User has reported dex2oat failure with SELinux log:

W dex2oat64: type=1400 audit(0.0:922): avc: denied { read } for path="/data/adb/modules/zygisk_lsposed/bin/liboat_hook64.so" dev="dm-58" ino=91204 scontext=u:r:dex2oat:s0 tcontext=u:object_r:adb_data_file:s0 tclass=file permissive=0

User has reported `dex2oat` failure with SELinux log:

W dex2oat64: type=1400 audit(0.0:922): avc: denied { read } for path="/data/adb/modules/zygisk_lsposed/bin/liboat_hook64.so" dev="dm-58" ino=91204 scontext=u:r:dex2oat:s0 tcontext=u:object_r:adb_data_file:s0 tclass=file permissive=0
@JingMatrix JingMatrix self-assigned this Feb 15, 2025
@JingMatrix JingMatrix linked an issue Feb 15, 2025 that may be closed by this pull request
1 task
@JingMatrix
Copy link
Copy Markdown
Owner Author

@aayushrautela try the latest CI build to see if your problem got fixed.

@aviraxp
Copy link
Copy Markdown
Contributor

aviraxp commented Feb 16, 2025

I think the issue is init relabels xposed_file when doing restorecon on /data, which is usually performed during ota. That's why magisk_file is often used in that dir.
https://android.googlesource.com/platform/system/sepolicy/+/refs/heads/main/private/init.te#362
Try make xposed_file system_file_type.

The init process may relable SELinux context, which can be prevented by marking the context xposed_file with type system_file_type.

See https://cs.android.com/android/platform/superproject/main/+/main:system/sepolicy/private/init.te;l=335
@JingMatrix
Copy link
Copy Markdown
Owner Author

Thanks for the information, I will let users to test your conjecture.

@JingMatrix JingMatrix merged commit 8f8f632 into master Feb 17, 2025
1 check passed
JingMatrix added a commit that referenced this pull request Feb 23, 2025
User has reported `dex2oat` failure with SELinux log:

```
W dex2oat64: type=1400 audit(0.0:922): avc: denied { read } for path="/data/adb/modules/zygisk_lsposed/bin/liboat_hook64.so" dev="dm-58" ino=91204 scontext=u:r:dex2oat:s0 tcontext=u:object_r:adb_data_file:s0 tclass=file permissive=0
```

Hence, we now set the SELinux context of `liboat_hook.so` in Dex2OatService.

Moreover, by the pull-request #194, we have to move `putenv` out of the if block by testing.
Indeed, if we call `putenv` inside the if block, then it is no longer valid out of the block.
MicrosoftPro12 added a commit to MicrosoftPro12/LSPosed_private that referenced this pull request Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Over-heating caused by LSPosed on Android 16 beta 2

2 participants